package cn.schoolwow.util.domain.compare.jsonarray;

import cn.schoolwow.quickflow.QuickFlowBuilder;
import cn.schoolwow.quickflow.domain.FlowContext;
import cn.schoolwow.util.module.compare.jsonarray.domain.CompareJSONArrayQueryOption;
import cn.schoolwow.util.module.compare.jsonarray.service.CompareJSONArrayCompositeBusiness;
import com.alibaba.fastjson.JSONArray;

import java.util.List;

public class CompareJSONArrayResponse {
    private FlowContext flowContext;

    public CompareJSONArrayResponse(CompareJSONArrayQueryOption compareJSONArrayQueryOption) {
        flowContext = QuickFlowBuilder.quickFlow().startFlow(new CompareJSONArrayCompositeBusiness())
                .putCurrentCompositeFlowData("compareJSONArrayQueryOption", compareJSONArrayQueryOption)
                .execute();
    }

    /**获取新增列表*/
    public JSONArray getAddCompareArray(){
        JSONArray addCompareArray = (JSONArray) flowContext.getData("addCompareArray");
        return addCompareArray;
    }

    /**获取更新列表*/
    public List<UpdateJSONArrayCompare> getUpdateJSONArrayCompareList(){
        List<UpdateJSONArrayCompare> updateJSONArrayCompareList = (List<UpdateJSONArrayCompare>) flowContext.getData("updateJSONArrayCompareList");
        return updateJSONArrayCompareList;
    }

    /**获取删除列表*/
    public JSONArray getDeleteCompareArray(){
        JSONArray deleteCompareArray = (JSONArray) flowContext.getData("deleteCompareArray");
        return deleteCompareArray;
    }

}
